package com.codedecent.scw;

import com.codedecent.scw.bean.TMenu;
import com.codedecent.scw.mapper.TMenuMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * codedecent
 * 2022/1/7
 */
@Controller
public class DispatcherController {
    @Autowired
    private TMenuMapper tMenuMapper;

    @ResponseBody
    @RequestMapping("/getMenu")
    public List<TMenu> getMenu(){
        System.out.println(tMenuMapper.selectByExample(null));
        return tMenuMapper.selectByExample(null);
    }

    @RequestMapping(value = {"/", "/index", "index.html"},method = RequestMethod.GET)
    public String index(){
        return "index";
    }
}
